<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
<html xmlns="http://www.w3.org/1999/xhtml"> 
<head> 
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 
<title>List Expander</title> 
 
<script type="text/javascript" src="jquery/jquery.js"></script> 
<script type="text/javascript" src="result.js"></script> 

 
<style> 


body{
	background:#f1f1f1;
	font:80% Arial, Helvetica, sans-serif; 
	color:#555;
	line-height:150%;
	text-align:left;
}
h1{
	font-size:140%;
	margin:0 20px;
	line-height:80px;	
}
h2{
	font-size:120%;
	line-height:10px;	
}
#container{
	margin:0 auto;
	width:880px;
	background:#fff;
	padding-bottom:20px;
}
#content{margin:0 20px;}
p{	
	margin:0 auto;
	width:680px;
	padding:1em 0;
}

#htmlpage{width:400px;
    height:150px;
    overflow:auto;padding: 4px;
    border:1px solid #EEE;border-right:0 solid;}
#htmlsource  { width:400px;
    height:150px;
    overflow:auto;padding: 4px;
    border:1px solid #EEE;border-right:0 solid;
    background:#fff;
}

#summary {
	width: 200px;
}


table {
	width: 840px;
	color: #212424;
	margin: 0 0 1em 0;	
	font: 80%/150% "Lucida Grande", "Lucida Sans Unicode", "Lucida Sans", Lucida, Helvetica, sans-serif;
}
table, tr, th, td {
	margin: 15;
	padding: 15;
	border-spacing: 0;
	border-collapse: collapse;
}

/* BODY */


tbody tr td {
	background-color: #fff;
	padding: 0.3em 0.4em;
	border: 1px solid #a6ce39;
}
tbody tr.odd td, tr.head td, tr.main td {
	background-color: #D0EBA6;
}
tbody tr.main td {
	font: 150% "Lucida Grande", "Lucida Sans Unicode", "Lucida Sans", Lucida, Helvetica, sans-serif;
}
tbody tr:hover td {
	background: #B3D286;
}

/* LINKS */

table a {
	color: #854400;
	text-decoration: none;
}
table a:visited {
	text-decoration: line-through;
}
table a:hover {
	text-decoration: underline;
}


</style> 
 
</head> 
 
<body> 

<div id="container"> 
	<h1>WebEnum</h1> 

	<div id="content"> 

	<table id="summary">
	  <tr><td id="expand">Expand all</td></tr>
	</table>
	
	<table id="report">
		  <script type="text/javascript">

		    function htmlspecialchars(str) {
		    if (typeof(str) == "string") {
		      str = str.replace(/&/g, "&amp;"); /* must do &amp; first */
		      str = str.replace(/"/g, "&quot;");
		      str = str.replace(/'/g, "&#039;");
		      str = str.replace(/</g, "&lt;");
		      str = str.replace(/>/g, "&gt;");
		      }
		    return str;
		    }

		    (function($){
			$.fn.jExpand = function(){
			    var element = this;

			    $(element).find("tr:not(.main)").hide();
			    $(element).find("tr:first-child").show();

			    $(element).find("tr.main").click(function() {
				$(this).nextUntil("tr.main").toggle();
			    });
			    
			}    
		    })(jQuery); 

		    
		    function formatObj(obj) {
		      var r=''
		      for(a in obj) {
			  r = r + ' ' + a + ' = ' + obj[a] + ', ';
		      }
		      
		      if(r.length>2)
			return r.slice(0,r.length-2);
		      return ' ';
		    }


		    var content = {}
		    for (resp in json) {

			var htm = document.open(resp + '.html');
		      
			plural='y'
			if(json[resp].length>1)
			    plural='ies'


			document.write('<tr class="main"><td colspan="6"><strong> ' + json[resp].length + ' quer' + plural + ' returned <a href="' + resp + '.html">' + resp + '.html</a> as response. </strong></td></tr>');
	
			document.write('<tr><td colspan="3"><h2>HTTP response code</h2><div id="htmlsource">' + json[resp][0][6] + '</div></td><td colspan="3"><h2>Click to visualize response page.</h2><div id="htmlpage"></div></td></tr>');

			document.write('<tr class="head"><td>Fuzz strings</td><td>URL</td><td>POST data</td><td>Headers</td><td>Status code</td></tr>');

			for(i=0;i<json[resp].length;i++) {
			      document.write('<tr><td>' + json[resp][i][3].join(', ') + '</td><td><a href ="' + json[resp][i][0] + '">' + json[resp][i][0] + '</a></td><td>' + formatObj(json[resp][i][1]) + '</td><td>' + formatObj(json[resp][i][2]) + '</td><td>' + json[resp][i][4] + '</td></tr>');
			}
			
		    }

		  
		  $("#report").jExpand(); 
		  $("#expand").click(function() {
				$(".main").nextUntil("tr.main").toggle();
				if($("#expand").text()=='Expand all') {
				  $("#expand").text('Collapse all');
				}
				else {
				  $("#expand").text('Expand all');
				}
		  });
		  
		  </script>
	</table>
	
	</div> 
</div> 
	
</body> 
</html> 
